/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// plnchart.hpp - PegLineChart class definition.
//
// Author: Jim DeLisle
//
// Copyright (c) 1997-2003 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGLINECHART_
#define _PEGLINECHART_

class PegLineChart : public PegChart
{
    public:
        PegLineChart(const PegRect &Size, PEGLONG MinX, PEGLONG MaxX, 
                     PEGLONG MinY, PEGLONG MaxY, PEGUINT XScale = 0, 
                     PEGUINT YScale = 0);
        virtual ~PegLineChart();
    
        PegChartPoint* AddPoint(PEGLONG X, PEGLONG Y);
        virtual void Draw(const PegRect &Invalid);
        PegChartPoint* GetFirstPoint() const { return mpPoints; }
        PEGCOLOR GetLineColor() const { return mLineColor; }
        PegChartPoint* InsertPoint(PegChartPoint* pPreviousPoint,
                                   PEGLONG X, PEGLONG Y);

        virtual PEGINT Message(const PegMessage& Mesg);
        void RecalcLine();
        virtual void RecalcSize(const PegRect& NewSize, PEGBOOL Redraw = TRUE);
        PegChartPoint* RemovePoint(PegChartPoint* pPoint);
        void ResetLine();
        virtual void Resize(const PegRect &NewSize);

        PEGCOLOR SetLineColor(PEGCOLOR Color)
        {
            PEGCOLOR Temp = mLineColor;
            mLineColor = Color;
            return Temp;
        }
        
    protected:
        PegChartPoint* mpPoints;
        PEGCOLOR mLineColor;
};

#endif // _PEGLINECHART_


